import React from 'react';
import {connect} from 'dva';
import Mainpage from "../components/test/Mainpage";
import MainLayout from '../components/MainLayout/MainLayout';
import styles from './Test.css';

function Test({location, dispatch, mainpage}) {
  const {collapsed} = mainpage;
  const mainpageProps = {
    collapsed,
    onCollapse(collapsed){
      dispatch({
        type: 'mainpage/collapse',
        payload: {collapsed}
      })
    }
  }
  return (
    <MainLayout location={location}>
      <div className={styles.normal}>
        <Mainpage {...mainpageProps}/>
      </div>
    </MainLayout>
  );
}

function mapStateToProps({mainpage}) {
  // console.log(mainpage)
  return {mainpage}
}

export default connect(mapStateToProps)(Test)
